import os


class FileManager(object):
    # 保存文件的名称
    file_name = ''
    file_path = ''

    def __init__(self, file_path, file_name):
        self.file_name = file_name
        self.file_path = file_path

    def file_is_exists(self):
        path = self.file_path + self.file_name
        if not os.path.exists(path):
            open(path, mode='w', encoding='utf-8')
            return False

    def read_conf(self):
        path = self.file_path + self.file_name
        confArr = []
        with open(path, 'r', encoding="utf-8") as file:
            for line in file.readlines():
                output = line.rstrip('\n')
                confArr.append(output)
            return confArr
